package cn.jc.spider.util;

public class Page {
	private int size;
	private int currentpage;
	private int totalcount;
	private String baseurl;
	
	public String getBaseurl() {
		return baseurl;
	}
	public void setBaseurl(String baseurl) {
		this.baseurl = baseurl;
	}
//	public String getPageinfo() {
//		return PageUtil.getPageContent(baseurl+(baseurl.contains("?")?"&":"?")+"p=","", totalcount, currentpage, size);
//	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getCurrentpage() {
		return currentpage;
	}
	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}
	public int getTotalcount() {
		return totalcount;
	}
	public int getTotal() {
		return totalcount;
	}
	public void setTotalcount(int totalcount) {
		this.totalcount = totalcount;
	}

	public int getStart() {
		return getStartItem(currentpage, size);
	}
	private int getStartItem(int curPage,int limit){
		int start = (curPage-1)*limit;
		return start<0?0:start;
	}
}
